<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>hexo-Butterfly-全局设置(安装、标题、菜单、图标、顶部、页脚、侧边栏、图片设置) | 梧桐的学习日记</title><meta name="author" content="梧桐影下月光卧"><meta name="copyright" content="梧桐影下月光卧"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Butterfly安装1git clone -b master https:&#x2F;&#x2F;gitee.com&#x2F;immyw&#x2F;hexo-theme-butterfly.git Butterfly主题应用在hexo里的_config.yml设置theme: Butterfly 全局设置（标题）网站资料、语言_config.yml：title、subject等配置 default(en) zh-CN (简体中文)">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo-Butterfly-全局设置(安装、标题、菜单、图标、顶部、页脚、侧边栏、图片设置)">
<meta property="og:url" content="https://acwy.fun/2023/04/10/hexo-Butterfly-1-%E5%85%A8%E5%B1%80%E8%AE%BE%E7%BD%AE(%E5%AE%89%E8%A3%85%E3%80%81%E6%A0%87%E9%A2%98%E3%80%81%E8%8F%9C%E5%8D%95%E3%80%81%E5%9B%BE%E6%A0%87%E3%80%81%E9%A1%B6%E9%83%A8%E3%80%81%E9%A1%B5%E8%84%9A%E3%80%81%E4%BE%A7%E8%BE%B9%E6%A0%8F%E3%80%81%E5%9B%BE%E7%89%87%E8%AE%BE%E7%BD%AE)/index.html">
<meta property="og:site_name" content="梧桐的学习日记">
<meta property="og:description" content="Butterfly安装1git clone -b master https:&#x2F;&#x2F;gitee.com&#x2F;immyw&#x2F;hexo-theme-butterfly.git Butterfly主题应用在hexo里的_config.yml设置theme: Butterfly 全局设置（标题）网站资料、语言_config.yml：title、subject等配置 default(en) zh-CN (简体中文)">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b">
<meta property="article:published_time" content="2023-04-10T12:52:23.000Z">
<meta property="article:modified_time" content="2023-11-29T09:41:02.979Z">
<meta property="article:author" content="梧桐影下月光卧">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="hexo-Butterfly - 静态博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b"><link rel="shortcut icon" href="/img/logo.png"><link rel="canonical" href="https://acwy.fun/2023/04/10/hexo-Butterfly-1-%E5%85%A8%E5%B1%80%E8%AE%BE%E7%BD%AE(%E5%AE%89%E8%A3%85%E3%80%81%E6%A0%87%E9%A2%98%E3%80%81%E8%8F%9C%E5%8D%95%E3%80%81%E5%9B%BE%E6%A0%87%E3%80%81%E9%A1%B6%E9%83%A8%E3%80%81%E9%A1%B5%E8%84%9A%E3%80%81%E4%BE%A7%E8%BE%B9%E6%A0%8F%E3%80%81%E5%9B%BE%E7%89%87%E8%AE%BE%E7%BD%AE)/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'hexo-Butterfly-全局设置(安装、标题、菜单、图标、顶部、页脚、侧边栏、图片设置)',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-11-29 17:41:02'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.2"></head><body><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pace-js/themes/blue/pace-theme-minimal.min.css"/><script src="https://cdn.jsdelivr.net/npm/pace-js/pace.min.js"></script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/img/logo.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">28</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 目录</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg fixed" id="page-header" style="background-image: url('https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b')"><nav id="nav"><span id="blog-info"><a href="/" title="梧桐的学习日记"><span class="site-name">梧桐的学习日记</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 目录</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">hexo-Butterfly-全局设置(安装、标题、菜单、图标、顶部、页脚、侧边栏、图片设置)</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-04-10T12:52:23.000Z" title="发表于 2023-04-10 20:52:23">2023-04-10</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-11-29T09:41:02.979Z" title="更新于 2023-11-29 17:41:02">2023-11-29</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">654</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>2分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="Butterfly安装"><a href="#Butterfly安装" class="headerlink" title="Butterfly安装"></a>Butterfly安装</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git</span><br></pre></td></tr></table></figure>
<h3 id="Butterfly主题应用"><a href="#Butterfly主题应用" class="headerlink" title="Butterfly主题应用"></a>Butterfly主题应用</h3><p>在<code>hexo</code>里的<code>_config.yml</code>设置<code>theme: Butterfly</code></p>
<h3 id="全局设置（标题）"><a href="#全局设置（标题）" class="headerlink" title="全局设置（标题）"></a>全局设置（标题）</h3><h4 id="网站资料、语言-config-yml："><a href="#网站资料、语言-config-yml：" class="headerlink" title="网站资料、语言_config.yml："></a>网站资料、语言<code>_config.yml</code>：</h4><p>title、subject等<br>配置 <code>default(en)</code> <code>zh-CN</code> (简体中文) <code>zh-TW</code> (繁体中文)</p>
<h4 id="菜单-config-butterfly-yml："><a href="#菜单-config-butterfly-yml：" class="headerlink" title="菜单_config.butterfly.yml："></a>菜单<code>_config.butterfly.yml</code>：</h4><blockquote>
<p>菜单名： 路径 || 图标 || hide<br>    子菜单： 路径 || 图标<br>默认子目录是展开的，如果你想要隐藏，在子目录里添加 hide </p>
</blockquote>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">Categories:</span> <span class="string">/categories/</span> <span class="string">||</span> <span class="string">fas</span> <span class="string">fa-folder-open</span></span><br><span class="line"><span class="string">List||fas</span> <span class="string">fa-list</span> <span class="string">||</span> <span class="attr">hide:</span></span><br><span class="line">  <span class="attr">Music:</span> <span class="string">/music/</span> <span class="string">||</span> <span class="string">fas</span> <span class="string">fa-music</span></span><br><span class="line">  <span class="attr">Movie:</span> <span class="string">/movies/</span> <span class="string">||</span> <span class="string">fas</span> <span class="string">fa-video</span></span><br></pre></td></tr></table></figure>
<h4 id="导航栏"><a href="#导航栏" class="headerlink" title="导航栏"></a>导航栏</h4><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">nav:</span></span><br><span class="line">  <span class="attr">logo:</span> <span class="comment">#image</span></span><br><span class="line">  <span class="attr">display_title:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">fixed:</span> <span class="literal">false</span> <span class="comment"># fixed navigation bar</span></span><br></pre></td></tr></table></figure>
<p>logo            网站的 logo，支持图片，直接填入图片链接<br>display_title    是否显示网站标题，填写 true 或者 false<br>fixed            是否固定状态栏，填写 true 或者 false</p>
<h3 id="图标设置-直达-gt"><a href="#图标设置-直达-gt" class="headerlink" title="图标设置 直达-&gt;"></a>图标设置 <a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/4aa8abbe/#%E7%A4%BE%E4%BA%A4%E5%9C%96%E6%A8%99">直达-&gt;</a></h3><p><a target="_blank" rel="noopener" href="https://fontawesome.com/search?q=email&o=r&s=solid">fontawesome</a></p>
<blockquote>
<p>要使用iconfont图标的地方： <code>iconfont wy-setting</code></p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">inject:</span><br><span class="line">  head:</span><br><span class="line">    # &lt;link rel=&quot;stylesheet&quot; href=&quot;//at.alicdn.com/t/c/font_2542806_ht4yfylg00s.css&quot;&gt;</span><br><span class="line">  bottom:</span><br><span class="line">    # - &lt;script src=&quot;xxxx&quot;&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure>
<h3 id="字数统计-npm-install-hexo-wordcount-修改：wordcount"><a href="#字数统计-npm-install-hexo-wordcount-修改：wordcount" class="headerlink" title="字数统计 npm install hexo-wordcount 修改：wordcount"></a>字数统计 <code>npm install hexo-wordcount</code> 修改：<code>wordcount</code></h3><h3 id="顶部图"><a href="#顶部图" class="headerlink" title="顶部图"></a><a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/4aa8abbe/#%E9%A1%B6%E9%83%A8%E5%9B%BE">顶部图</a></h3><p><code>disable_top_img: true</code> 禁止顶部图<br>index_img           主页的 top_img<br>default_top_img        默认的 top_img，当页面的 top_img 没有配置时，会显示 default_top_img<br>archive_img            归档页面的 top_img<br>tag_img    tag         子页面 的 默认 top_img<br>tag_per_img    tag     子页面的 top_img，可配置每个 tag 的 top_img<br>category_img        category 子页面 的 默认 top_img<br>category_per_img    category 子页面的 top_img，可配置每个 category 的 top_img</p>
<h3 id="页脚，用于备案等：footer"><a href="#页脚，用于备案等：footer" class="headerlink" title="页脚，用于备案等：footer"></a>页脚，用于备案等：<code>footer</code></h3><p>since是一个来展示你站点起始时间的选项<br>custom_text:页脚自定义文本的选项,支持 HTML</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">custom_text:</span> <span class="string">&lt;a</span> <span class="string">href=&quot;icp链接&quot;&gt;&lt;img</span> <span class="string">class=&quot;icp-icon&quot;</span> <span class="string">src=&quot;icp图片&quot;&gt;&lt;span&gt;备案号：xxxxxx&lt;/span&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="comment"># footer是否显示图片背景(与top_img一致) </span></span><br><span class="line"><span class="comment"># 留空/false 显示默认的顔色</span></span><br><span class="line"><span class="comment"># img链接 图片的链接，显示所配置的图片</span></span><br><span class="line"><span class="comment"># 顔色(HEX值 - #0000FF RGB值 - rgb(0,0,255) 顔色单词 - orange 渐变色 - linear-gradient( 135deg, #E2B0FF 10%, #9F44D3 100%)）</span></span><br><span class="line"><span class="comment"># true 显示跟 top_img 一样</span></span><br><span class="line"><span class="attr">footer_bg:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>

<h3 id="侧边栏"><a href="#侧边栏" class="headerlink" title="侧边栏"></a>侧边栏</h3><h5 id="作者卡片"><a href="#作者卡片" class="headerlink" title="作者卡片"></a>作者卡片</h5><p><code>card_author</code></p>
<h5 id="公告卡片"><a href="#公告卡片" class="headerlink" title="公告卡片"></a>公告卡片</h5><p><code>card_announcement:</code></p>
<h5 id="访问人数-busuanzi-UV-和-PV"><a href="#访问人数-busuanzi-UV-和-PV" class="headerlink" title="访问人数 busuanzi (UV 和 PV) "></a>访问人数 <code>busuanzi (UV 和 PV) </code></h5><h5 id="网页已运行时间-runtimeshow"><a href="#网页已运行时间-runtimeshow" class="headerlink" title="网页已运行时间 runtimeshow"></a>网页已运行时间 <code>runtimeshow</code></h5><h3 id="自定义侧边栏-gt-直达"><a href="#自定义侧边栏-gt-直达" class="headerlink" title="自定义侧边栏  -&gt;直达"></a>自定义侧边栏  <a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/ea33ab97/">-&gt;直达</a></h3><h3 id="背景、特效"><a href="#背景、特效" class="headerlink" title="背景、特效"></a>背景、特效</h3><ol>
<li>背景<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 图片格式 url(http://xxxxxx.com/xxx.jpg) 本地：url(/blog/img/xx.png)</span></span><br><span class="line"><span class="comment"># 颜色（HEX值/RGB值/顔色单词/渐变色) background:&#x27;#49B202&#x27;</span></span><br><span class="line"><span class="comment"># 留空 不显示背景</span></span><br><span class="line"><span class="attr">background:</span> <span class="string">url(/blog/img/xx.png)</span></span><br></pre></td></tr></table></figure></li>
<li>彩带 <a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/ceeb73f/#%E8%83%8C%E6%99%AF%E7%89%B9%E6%95%88">-&gt;直达</a><br><code>canvas_ribbon</code></li>
<li>鼠标<a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/ceeb73f/#%E9%BC%A0%E6%A8%99%E9%BB%9E%E6%93%8A%E6%95%88%E6%9E%9C">-&gt;直达</a><br><code>fireworks</code> 烟花 <code>click_heart:</code>爱心 <code>ClickShowText:</code> 文字</li>
<li>打字效果 <code>activate_power_mode</code></li>
<li>页面加载动画 <code>preloader</code></li>
</ol>
<h3 id="文章图片-封面-cover"><a href="#文章图片-封面-cover" class="headerlink" title="文章图片 封面 cover"></a>文章图片 封面 <code>cover</code></h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">cover</span> </span><br><span class="line">  <span class="comment"># 是否显示文章封面 文章图片</span></span><br><span class="line">  <span class="attr">index_enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">aside_enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">archives_enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="comment"># 封面显示的位置</span></span><br><span class="line">  <span class="comment"># 三个值可配置 left , right , both</span></span><br><span class="line">  <span class="attr">position:</span> <span class="string">both</span></span><br><span class="line">  <span class="comment"># 当没有设置cover时，默认的封面显示</span></span><br><span class="line">  <span class="attr">default_cover:</span> </span><br></pre></td></tr></table></figure></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://acwy.fun">梧桐影下月光卧</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://acwy.fun/2023/04/10/hexo-Butterfly-1-%E5%85%A8%E5%B1%80%E8%AE%BE%E7%BD%AE(%E5%AE%89%E8%A3%85%E3%80%81%E6%A0%87%E9%A2%98%E3%80%81%E8%8F%9C%E5%8D%95%E3%80%81%E5%9B%BE%E6%A0%87%E3%80%81%E9%A1%B6%E9%83%A8%E3%80%81%E9%A1%B5%E8%84%9A%E3%80%81%E4%BE%A7%E8%BE%B9%E6%A0%8F%E3%80%81%E5%9B%BE%E7%89%87%E8%AE%BE%E7%BD%AE)/">https://acwy.fun/2023/04/10/hexo-Butterfly-1-%E5%85%A8%E5%B1%80%E8%AE%BE%E7%BD%AE(%E5%AE%89%E8%A3%85%E3%80%81%E6%A0%87%E9%A2%98%E3%80%81%E8%8F%9C%E5%8D%95%E3%80%81%E5%9B%BE%E6%A0%87%E3%80%81%E9%A1%B6%E9%83%A8%E3%80%81%E9%A1%B5%E8%84%9A%E3%80%81%E4%BE%A7%E8%BE%B9%E6%A0%8F%E3%80%81%E5%9B%BE%E7%89%87%E8%AE%BE%E7%BD%AE)/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://acwy.fun" target="_blank">梧桐的学习日记</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/hexo/">hexo</a><a class="post-meta__tags" href="/tags/hexo-Butterfly-%E9%9D%99%E6%80%81%E5%8D%9A%E5%AE%A2/">hexo-Butterfly - 静态博客</a></div><div class="post_share"><div class="social-share" data-image="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/img/wechatpay.png" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="/img/wechatpay.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/img/alipay.png" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="/img/alipay.png" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/04/10/hexo-Butterfly-2-%E7%94%9F%E6%88%90%E6%96%87%E7%AB%A0%E5%92%8C%E9%A1%B5%E9%9D%A2/" title="hexo-Butterfly-2-生成文章和页面"><img class="cover" src= "" data-lazy-src="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">hexo-Butterfly-2-生成文章和页面</div></div></a></div><div class="next-post pull-right"><a href="/2023/04/10/hexo-%E5%AE%89%E8%A3%85%E5%8F%91%E8%A1%8C/" title="hexo-安装发行"><img class="cover" src= "" data-lazy-src="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">hexo-安装发行</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2023/08/24/hexo-Butterfly-4-%E5%A4%96%E6%8C%82%E6%A0%87%E7%AD%BEtab%E3%80%81button%E3%80%81%E5%9B%BE%E7%89%87%E3%80%81%E9%AB%98%E4%BA%AE%E3%80%81%E8%87%AA%E5%AE%9A%E4%B9%89html/" title="hexo-Butterfly-4-外挂标签tab、button、图片、高亮、自定义html"><img class="cover" src= "" data-lazy-src="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-08-24</div><div class="title">hexo-Butterfly-4-外挂标签tab、button、图片、高亮、自定义html</div></div></a></div><div><a href="/2023/04/10/hexo-Butterfly-3-%E6%96%87%E7%AB%A0%E9%A1%B5%E8%AE%BE%E7%BD%AE/" title="hexo-Butterfly-3-文章页设置"><img class="cover" src= "" data-lazy-src="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-04-10</div><div class="title">hexo-Butterfly-3-文章页设置</div></div></a></div><div><a href="/2023/04/10/hexo-Butterfly-2-%E7%94%9F%E6%88%90%E6%96%87%E7%AB%A0%E5%92%8C%E9%A1%B5%E9%9D%A2/" title="hexo-Butterfly-2-生成文章和页面"><img class="cover" src= "" data-lazy-src="https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-04-10</div><div class="title">hexo-Butterfly-2-生成文章和页面</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="/img/logo.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">梧桐影下月光卧</div><div class="author-info__description">分享个人学习路上的小知识</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">28</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://beau.acwy.fun"><i class="fa-solid fa-envelope"></i><span>点击联系我</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content"><b> <font color="#e66b6d">欢</font> <font color="#e66d98">迎</font> <font color="#e66cc6">访</font> <font color="#cc6de6">问</font> <font color="#9770e6">a</font> <font color="#6d93e6">c</font> <font color="#6fcde6">w</font> <font color="#72e6b6">y</font> <font color="#72e689">的</font> <font color="#99e670">学</font> <font color="#cde670">习</font> <font color="#e6df72">日</font> <font color="#e6c073">记</font> </b> <p align="center"> <img src= "" data-lazy-src="https://upyun.acwy.fun/acwy.fun/公告1.gif" width="50" alt="mao"> </p> <p align="center">微信：acwy0718</p> <p align="center">邮箱：awy0718@gmail.com</p></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Butterfly%E5%AE%89%E8%A3%85"><span class="toc-number">1.</span> <span class="toc-text">Butterfly安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Butterfly%E4%B8%BB%E9%A2%98%E5%BA%94%E7%94%A8"><span class="toc-number">2.</span> <span class="toc-text">Butterfly主题应用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%A8%E5%B1%80%E8%AE%BE%E7%BD%AE%EF%BC%88%E6%A0%87%E9%A2%98%EF%BC%89"><span class="toc-number">3.</span> <span class="toc-text">全局设置（标题）</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E8%B5%84%E6%96%99%E3%80%81%E8%AF%AD%E8%A8%80-config-yml%EF%BC%9A"><span class="toc-number">3.1.</span> <span class="toc-text">网站资料、语言_config.yml：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%8F%9C%E5%8D%95-config-butterfly-yml%EF%BC%9A"><span class="toc-number">3.2.</span> <span class="toc-text">菜单_config.butterfly.yml：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AF%BC%E8%88%AA%E6%A0%8F"><span class="toc-number">3.3.</span> <span class="toc-text">导航栏</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9B%BE%E6%A0%87%E8%AE%BE%E7%BD%AE-%E7%9B%B4%E8%BE%BE-gt"><span class="toc-number">4.</span> <span class="toc-text">图标设置 直达-&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AD%97%E6%95%B0%E7%BB%9F%E8%AE%A1-npm-install-hexo-wordcount-%E4%BF%AE%E6%94%B9%EF%BC%9Awordcount"><span class="toc-number">5.</span> <span class="toc-text">字数统计 npm install hexo-wordcount 修改：wordcount</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%A1%B6%E9%83%A8%E5%9B%BE"><span class="toc-number">6.</span> <span class="toc-text">顶部图</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%A1%B5%E8%84%9A%EF%BC%8C%E7%94%A8%E4%BA%8E%E5%A4%87%E6%A1%88%E7%AD%89%EF%BC%9Afooter"><span class="toc-number">7.</span> <span class="toc-text">页脚，用于备案等：footer</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BE%A7%E8%BE%B9%E6%A0%8F"><span class="toc-number">8.</span> <span class="toc-text">侧边栏</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BD%9C%E8%80%85%E5%8D%A1%E7%89%87"><span class="toc-number">8.0.1.</span> <span class="toc-text">作者卡片</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%85%AC%E5%91%8A%E5%8D%A1%E7%89%87"><span class="toc-number">8.0.2.</span> <span class="toc-text">公告卡片</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%AE%BF%E9%97%AE%E4%BA%BA%E6%95%B0-busuanzi-UV-%E5%92%8C-PV"><span class="toc-number">8.0.3.</span> <span class="toc-text">访问人数 busuanzi (UV 和 PV) </span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%BD%91%E9%A1%B5%E5%B7%B2%E8%BF%90%E8%A1%8C%E6%97%B6%E9%97%B4-runtimeshow"><span class="toc-number">8.0.4.</span> <span class="toc-text">网页已运行时间 runtimeshow</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%87%AA%E5%AE%9A%E4%B9%89%E4%BE%A7%E8%BE%B9%E6%A0%8F-gt-%E7%9B%B4%E8%BE%BE"><span class="toc-number">9.</span> <span class="toc-text">自定义侧边栏  -&gt;直达</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%83%8C%E6%99%AF%E3%80%81%E7%89%B9%E6%95%88"><span class="toc-number">10.</span> <span class="toc-text">背景、特效</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%9B%BE%E7%89%87-%E5%B0%81%E9%9D%A2-cover"><span class="toc-number">11.</span> <span class="toc-text">文章图片 封面 cover</span></a></li></ol></div></div></div></div></main><footer id="footer" style="background-image: url('https://pic1.zhimg.com/v2-f5ca1150bf22dd77e636b0e2fced6d1c_1440w.jpg?source=172ae18b')"><div id="footer-wrap"><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><div> <a href="https://beian.miit.gov.cn/" target="_blank">豫ICP备2023010490号-1</a> </div> <div> <a style="display:flex;justify-content:center;align-items:center;" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=41152402000204"> <img src= "" data-lazy-src="/img/beian.png" style="width:20px;height:20px;margin:0 5px"> <span>豫公网安备 41152402000204号</span> </a> </div> <div> <a style="display:flex;justify-content:center;" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" target="_blank"> <span>本网站由</span> <img style="height:30px;margin:0 3px" src= "" data-lazy-src="/img/upyun_logo5.png"> <span>提供CDN加速/云存储服务</span> </a> <div/></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><div class="js-pjax"></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/fireworks.min.js"></script><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script></div></body></html>